/**
 * @Author 12629
 * @Description：
 */
public class Test {

    public static void main(String[] args) {

    }
    public static int countSegments(String s) {
        if(s.length() == 0) {
            return 0;
        }
        String[] ret = s.split(" ");

        //System.out.println(ret.length);
        int count = 0;
        for(String s1 : ret) {
            if(s1.length() != 0) {
                count++;
            }
        }
        return count;
    }

    public boolean isUpper(char ch) {
        if(ch >= 'A' && ch <= 'Z') {
            return true;
        }
        return false;
    }
    public String toLowerCase(String s) {
        StringBuffer stringBuffer = new StringBuffer();
        for(int i = 0;i < s.length();i++) {
            char ch = s.charAt(i);
            if(isUpper(ch)) {
                ch = (char)(ch+32);
                stringBuffer.append(ch);
            }else {
                stringBuffer.append(ch);
            }
        }
        return stringBuffer.toString();
    }
    public static void main1(String[] args) {
        countSegments(", , , ,        a, eaefa");
    }
}
